package cn.vc.auth.feign.clients;

import cn.vc.auth.entity.po.VUser;
import cn.vc.basicmodule.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "auth-service", path = "/auth/user")
public interface UserClient {
    /**
     * <h2>实名认证</h2>
     * @param captcha
     * @param name
     * @param idNum
     * @return
     */
    @PostMapping("/1")
    Result<VUser> realNameAuthentication(@RequestParam("captcha") String captcha, @RequestParam("name") String name, @RequestParam("idNum") String idNum);
    /**
     * <h2>蓝V认证</h2>
     * @return
     */
    @PostMapping("/2")
    Result<?> blueVAuthentication();
    /**
     * <h2>商铺认证</h2>
     * @return
     */
    @PostMapping("/3")
    Result<?> shopAuthentication();
    /**
     * <h2>签到</h2>
     * @return
     */
    @PostMapping("/signIn")
    Result<?> signIn();



    /**
     * <h2>注销用户</h2>
     * @param username
     * @param account
     * @param password
     * @param email
     * @param captcha
     * @return
     */
    @DeleteMapping()
    Result<?> signOut(@RequestParam("username") String username, @RequestParam("account") String account, @RequestParam("password") String password, @RequestParam("email") String email, @RequestParam("captcha") String captcha);

    /**
     * <h2>查询用户</h2>
     * @param account
     * @param password
     * @return
     */
    @GetMapping()
    Result<VUser> selectUser(@RequestParam("account") String account, @RequestParam("password") String password);



    /**
     * <h2>修改用户名</h2>
     * @param username 修改后的用户名
     * @return
     */
    @PutMapping("/username")
    Result<VUser> updateUsername(@RequestParam String username);
    /**
     * <h2>修改密码</h2>
     * @param oldPassword 旧密码
     * @param newPassword 新密码
     * @param captcha 验证码
     * @return
     */
    @PutMapping("/password")
    Result<VUser> updatePassword(@RequestParam("oldPassword") String oldPassword, @RequestParam("newPassword") String newPassword, @RequestParam("captcha") String captcha);
}
